﻿(function($) {
	$.fn.validationEngineLanguage = function() {
	};
	$.validationEngineLanguage = {
		newLang : function() {
			$.validationEngineLanguage.allRules = {
				"required" : { // Add your regex rules here, you can take
								// telephone as an example
					"regex" : "none",
					"alertText" : "* This field is required",
					"alertTextCheckboxMultiple" : "* Please select an option",
					"alertTextCheckboxe" : "* This checkbox is required"
				},
				"length" : {
					"regex" : "none",
					"alertText" : "*Between ",
					"alertText2" : " and ",
					"alertText3" : " characters allowed"
				},
				"charLength" : {
					"regex" : "none",
					"alertText" : "*Between ",
					"alertText2" : " and ",
					"alertText3" : " characters allowed"
				},
				"maxCheckbox" : {
					"regex" : "none",
					"alertText" : "* Checks allowed Exceeded"
				},
				"minCheckbox" : {
					"regex" : "none",
					"alertText" : "* Please select ",
					"alertText2" : " options"
				},
				"confirm" : {
					"regex" : "none",
					"alertText" : "* Your field is not matching"
				},
				"telephone" : {
					"regex" : "/^[0-9\-\(\)\ ]+$/",
					"alertText" : "* Invalid phone number"
				},
				"email" :{
					"regex" : "/^[a-zA-Z0-9_\.\-]+\@([a-zA-Z0-9\-]+\.)+\.[a-zA-Z0-9]{2,4}$/",
					"alertText" : "* Invalid email address"
				},
				"date" : {
					"regex" : "/(^\d{4}-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))$|((0[469]|11)-(0[1-9]|[12][0-9]|30))$|(02-(0[1-9]|[1][0-9]|2[0-8]))))$|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)$/",
					"alertText" : "* Invalid date, must be in YYYY-MM-DD format"
				},
				"onlyNumber" : {
					"regex" : "/^[0-9\ ]+$/",
					"alertText" : "* Numbers only"
				},
				"noSpecialCaracters" : {
					"regex" : "/^[0-9a-zA-Z]+$/",
					"alertText" : "* No special caracters allowed"
				},
				"ajaxUser" : {
					"file" : "validateUser.php",
					"extraData" : "name=eric",
					"alertTextOk" : "* This user is available",
					"alertTextLoad" : "* Loading, please wait",
					"alertText" : "* This user is already taken"
				},
				"ajaxName" : {
					"file" : "validateUser.php",
					"alertText" : "* This name is already taken",
					"alertTextOk" : "* This name is available",
					"alertTextLoad" : "* Loading, please wait"
				},
				"onlyLetter" : {
					"regex" : "/^[a-zA-Z\ \']+$/",
					"alertText" : "* Letters only"
				},
				"validate2fields" : {
					"nname" : "validate2fields",
					"alertText" : "* You must have a firstname and a lastname"
				},
				"moneyNumber" : {
					"regex" : "/^[0-9\ ]+$/",
					"alertText" : "* Money only"
				},
				"currency" : {
					"regex" : "/^([+-])?(\\d+(,\\d\\d\\d)*(\\.\\d{1,2})?|\\d+(\\.\\d{1,2})?)$/",
					"alertText" : "* 请输入有效货币（可以是千分位格式，最多两位小数）"
				},
				"mobilePhone" : {
					"regex" : "/^0{0,1}(13[0-9]|15[7-9]|153|156|18[7-9])[0-9]{8}$/",
					"alertText" : "* 请输入正确的手机号。"
				}
			}

		}
	}
})(jQuery);

$(document).ready(function() {
	$.validationEngineLanguage.newLang()
});